package com.demo.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Bean;
import java.util.HashMap;
import java.util.Map;

/**
 * 哈尔滨信息工程学院特色配置
 */
@Configuration
public class HarbinInfoConfig {
    
    /**
     * 哈尔滨信息工程学院院系配置
     */
    @Bean("harbinInfoDepartments")
    public Map<String, Object> getHarbinInfoDepartments() {
        Map<String, Object> departments = new HashMap<>();
        
        // 计算机学院
        Map<String, Object> computerDept = new HashMap<>();
        computerDept.put("name", "计算机学院");
        computerDept.put("code", "CS");
        computerDept.put("majors", new String[]{"软件工程", "网络工程", "数据科学与大数据技术", "人工智能"});
        computerDept.put("classroomTypes", new String[]{"普通教室", "机房", "实验室"});
        departments.put("计算机学院", computerDept);
        
        // 电子工程学院
        Map<String, Object> electronicDept = new HashMap<>();
        electronicDept.put("name", "电子工程学院");
        electronicDept.put("code", "EE");
        electronicDept.put("majors", new String[]{"电子信息工程", "通信工程", "物联网工程"});
        electronicDept.put("classroomTypes", new String[]{"普通教室", "实验室", "语音室"});
        departments.put("电子工程学院", electronicDept);
        
        // 经济管理学院
        Map<String, Object> businessDept = new HashMap<>();
        businessDept.put("name", "经济管理学院");
        businessDept.put("code", "BM");
        businessDept.put("majors", new String[]{"工商管理", "会计学", "市场营销", "财务管理"});
        businessDept.put("classroomTypes", new String[]{"普通教室", "多媒体教室"});
        departments.put("经济管理学院", businessDept);
        
        // 外国语学院
        Map<String, Object> foreignDept = new HashMap<>();
        foreignDept.put("name", "外国语学院");
        foreignDept.put("code", "FL");
        foreignDept.put("majors", new String[]{"英语", "日语", "商务英语"});
        foreignDept.put("classroomTypes", new String[]{"普通教室", "语音室", "多媒体教室"});
        departments.put("外国语学院", foreignDept);
        
        return departments;
    }
    
    /**
     * 哈尔滨信息工程学院作息时间配置
     */
    @Bean("harbinInfoSchedule")
    public Map<String, Object> getHarbinInfoSchedule() {
        Map<String, Object> schedule = new HashMap<>();
        
        // 作息时间表
        Map<String, String> timeSlots = new HashMap<>();
        timeSlots.put("1", "08:00-08:45");
        timeSlots.put("2", "08:55-09:40");
        timeSlots.put("3", "10:00-10:45");
        timeSlots.put("4", "10:55-11:40");
        timeSlots.put("5", "14:00-14:45");
        timeSlots.put("6", "14:55-15:40");
        timeSlots.put("7", "16:00-16:45");
        timeSlots.put("8", "16:55-17:40");
        
        schedule.put("timeSlots", timeSlots);
        schedule.put("lunchBreak", "11:40-14:00");
        schedule.put("dinnerBreak", "17:40-19:00");
        
        return schedule;
    }
    
    /**
     * 哈尔滨信息工程学院排课规则配置
     */
    @Bean("harbinInfoRules")
    public Map<String, Object> getHarbinInfoRules() {
        Map<String, Object> rules = new HashMap<>();
        
        // 核心约束规则
        Map<String, Object> coreRules = new HashMap<>();
        coreRules.put("teacherConflict", "同一教师不能在同一时间段教授多门课程");
        coreRules.put("classroomConflict", "同一教室不能在同一时间段安排多门课程");
        coreRules.put("studentConflict", "同一班级不能在同一时间段安排多门课程");
        
        // 特殊规则
        Map<String, Object> specialRules = new HashMap<>();
        specialRules.put("experimentPriority", "实验课程优先安排在实验室");
        specialRules.put("sportsOutdoor", "体育课程优先安排在室外场地");
        specialRules.put("languageLab", "外语课程优先安排在语音室");
        specialRules.put("computerLab", "计算机课程优先安排在机房");
        
        // 优化规则
        Map<String, Object> optimizationRules = new HashMap<>();
        optimizationRules.put("teacherPreference", "尽量满足教师的时间偏好");
        optimizationRules.put("classroomUtilization", "优化教室使用率");
        optimizationRules.put("timeDistribution", "教师时间分布均匀");
        
        rules.put("coreRules", coreRules);
        rules.put("specialRules", specialRules);
        rules.put("optimizationRules", optimizationRules);
        
        return rules;
    }
}









